{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "80577d70-0ca0-42ba-8e54-fc539bccc05a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "请输入三角形的边a： 2\n",
      "请输入三角形的边b： 3\n",
      "请输入三角形的边c： 4\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "该三角形为其他三角形！\n"
     ]
    }
   ],
   "source": [
    "a = float(input(\"请输入三角形的边a：\"))\n",
    "b = float(input(\"请输入三角形的边b：\"))\n",
    "c = float(input(\"请输入三角形的边c：\"))\n",
    "if (a>0 and b>0 and c>0 and a+b>c and a+c>b and b+c>a):\n",
    "    #print(\"三角形三边：a=\",a,\",b=\",b,\",c=\",c)\n",
    "    if (a == b and b == c):print(\"该三角形为等边三角形！\")\n",
    "    elif (a==b or b==c or a==c):print(\"该三角形为等腰三角形！\")\n",
    "    elif (a*a+b*b == c*c or a*a+c*c == b*b or c*c+b*b == a*a):print(\"该三角形为直角三角形！\")\n",
    "    else:print(\"该三角形为其他三角形！\")\n",
    "else:print(\"无法构成三角形！\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bea8e4a1-dbf5-4632-ac0e-04c70f8e3b44",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
